﻿using QFramework;

namespace HKTools
{
    public class CMD_UDP_BroadcastMsg : AbstractCommand
    {
        string msg;
        int broadcastPort;

        public CMD_UDP_BroadcastMsg(string msg, int broadcastPort)
        {
            this.msg = msg;
            this.broadcastPort = broadcastPort;
        }

        protected override void OnExecute()
        {
            if (string.IsNullOrEmpty(msg))
            {
                HKDebug.LogError("Msg 不能为空");
                return;
            }

            this.GetSystem<IHK_UdpSystem>().BroadcastMsg(msg, broadcastPort);
        }
    }
}